<template>
  <my-table ref="tableRef" :columns="columns" isNeedPage stripe :pageAjax="pageAjax">
    <template slot="operation" slot-scope="{ scope }">
      <el-button
        round
        size="small"
        :disabled="scope.row.result !== '0' || scope.row.dealer != loginId"
        @click="doAudit(scope.row)"
      >审核</el-button>
      <el-button
        round
        size="small"
        :disabled="scope.row.result !== '0' || scope.row.createBy != loginId"
        @click="doWithdraw(scope.row)"
      >撤回</el-button>
    </template>
  </my-table>
</template>

<script>
export default {
  data() {
    return {
      columns: [
        {
          fieldName: 'demandTestChildNo',
          label: '测试任务编号',
        },
        {
          fieldName: 'functionName',
          label: '功能名称',
        },
        {
          fieldName: 'functionNo',
          label: '功能编号',
        },
        {
          fieldName: 'createName',
          label: '申请人',
          width: 100,
        },
        {
          fieldName: 'originalPlanTestEndTime',
          label: '原计划测试完成时间',
          dateFormat: 'YYYY-MM-DD',
        },
        {
          fieldName: 'planTestEndTime',
          label: '现计划测试完成时间',
          dateFormat: 'YYYY-MM-DD',
        },
        {
          fieldName: 'createTime',
          label: '申请日期',
          dateFormat: 'YYYY-MM-DD',
        },
        {
          fieldName: 'result',
          label: '审核状态',
          width: 120,
          type: 'tag',
          attr: {
            dynamicType: {
              func: (row) => {
                return row.result == '1'
                  ? 'success'
                  : row.result == '2'
                    ? 'danger'
                    : 'warning'
              },
            },
            hit: true,
            size: 'small',
          },
          options: auditStatuOptions,
        },
        {
          slotname: 'operation',
          label: '操作',
          width: 180,
        },
      ],
    }
  }
}
</script>

<style>
</style>